import java.sql.SQLOutput;


public class Test {
    public static int x;
    public static MyThread t3;
    public static void main(String[] args) throws InterruptedException {

        Thread t1 = new Thread(() -> {
            System.out.println("0");
        });
        Thread t2 = new Thread(() -> {
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("1");
        });

        for (x = 3; x < 5; x++) {
            t3 = new MyThread();
        }
        t1.start();
        t2.start();
        t3.start();
        t1.join();
        t2.join();
        t3.join();

    }
}
//class Test2 {
//    static boolean func (char c) {
//        System.out.println(c);
//        return true;
//    }
//
//    public static void main(String[] args) {
//        int i = 0;
//        for (func('A');func('B')&&(i < 2);func('C')) {
//            i++;
//            func('D');
//        }
//    }
//}